from django.db import models


class SubscriptionUser(models.Model):
    openid = models.CharField(default='', max_length=50, db_index=True, verbose_name='用户openid')
    union_code = models.CharField(default='', max_length=50, verbose_name='由于个人公众发无法绑定联合平台，因此采用自己生成绑定码的方式', db_index=True)
    subscribe = models.IntegerField(default=0, db_index=True, verbose_name='是否订阅 0未订阅 1已订阅')
    subscribe_time = models.IntegerField(default=0, verbose_name='最后关注时间戳')
    remark = models.CharField(default='', max_length=30, verbose_name='公众号运营者对粉丝的备注')
    groupid = models.IntegerField(default=0, verbose_name='用户分组id')
    tagid = models.CharField(default='', max_length=255, verbose_name='由分号分隔的标签id')
    subscribe_scene = models.CharField(default='', max_length=255, verbose_name='用户关注来源')
    role = models.CharField(default='normal', max_length=10, db_index=True, verbose_name='normal普通用户  developer开发者')
    subscription = models.CharField(default='beachburg', max_length=10, db_index=True, verbose_name='表示是哪个公众号  beachburg比奇堡  tips测试推送公众号')
    location_adcode = models.CharField(default='', max_length=10, verbose_name='用户所在行政区划编码')
    location_name = models.CharField(default='', max_length=50, verbose_name='地理名称')

    class Meta:
        db_table = 'subscription_user'
